package com.jz.community.moduleshoppingguide.nearshop.ui.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jz.community.basecomm.utils.SHelper;
import com.jz.community.moduleshoppingguide.R;

import java.util.List;


public class SearchHotWordAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public SearchHotWordAdapter(int layoutResId, @Nullable List<String> data) {
        super(layoutResId, data);
        mData = data;
    }

    @Override
    protected void convert(BaseViewHolder helper, String entity) {
        helper.setText(R.id.item_search_near_tv, entity);

        ImageView line = helper.getView(R.id.item_search_near_line);

        //添加分割线
        if (helper.getAdapterPosition() != mData.size() - 1) {
            SHelper.vis(line);
        } else {
            SHelper.gone(line);
        }
    }
}
